<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    public function __construct()
    {

        //检查权限
        $this->_initialize();
    }

   public function _initialize()
   {

   }

   public function sucRes($code=200,$data=[]): bool|string
   {
       return json_encode([
           'code'=>$code,
           'data'=>$data
       ]);
   }

   public function errRes($code=-1,$message=''): bool|string
   {
       return json_encode([
           'code'=>$code,
           'message'=>$message
       ]);
   }

}
